#include<iostream>
#include<cstring>
#include<cmath>
using namespace std;
#define ll long long int
ll n,a,maxx;
ll tong[100002];
ll pre[100002];
ll ans;
int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    scanf("%d",&n);
    for(int i=0;i<n;i++)
    {
        scanf("%d",&a);
        tong[a]++;
        if(a>maxx)
            maxx=a;
    }
    for(int i=maxx;i>=0;i--)
        pre[i]=pre[i+1]+tong[i];
    ll num;
    for(int i=0;i<=maxx;i++)
    {
        num=min(num,pre[i+1]);
        if(num>=tong[i])
            num-=tong[i];
        else
        {
            printf("%lld\n",pre[i+1]+tong[i]-num);
            return 0;
        }
    }
    printf("WWW!!!\n");
    fclose(stdin);
    fclose(stdout);
    return 0;
}
